package com.cn.util;

import java.util.Scanner;

public class ScannerAddArray {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        int[] arr = {1, 1, 1, 1, 1};
        int[] arr = new int[5];
        for (int i = 0; i < 5; i++) {
            System.out.println("请输入第" + (i + 1) + "个数");
            arr[i] = scanner.nextInt();
        }
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        System.out.println(max);
        int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        System.out.println(min);
    }
}
